return "COLLISION DETECTION" & RETURN & RETURN & "This behavior detects when the current sprite intersects other sprites." & RETURN & RETURN & "TIP: Use matte ink to limit intersection to the visible area of the sprite. (This does not work with all member types)." & RETURN & RETURN & "You can choose whether to test for intersection with all sprites or only a certain selection. In this way, you can make some sprites mutually 'invisible'." & RETURN & RETURN & "This behavior broadcasts a 'Collision_NewsFlash' message whenever the current sprite collides with another in the selected group." & RETURN & RETURN & "You can discover which sprites this sprite currently intersects by sending a '#Collision_GetIntersectList' message." & RETURN & RETURN & "PERMITTED MEMBER TYPES:" & RETURN & "Any visible members" & RETURN & RETURN & "PARAMETERS:" & RETURN & "* Test mode:" & RETURN & " - all sprites " & RETURN & " - all current sprites " & RETURN & " - sprites in lower channels" & RETURN & " - current sprites in lower channels" & RETURN & " - sprites with the same behavior in lower channels" & RETURN & " - sprites with the same ID in lower channels" & RETURN & "* Optional ID for this group" & RETURN & RETURN & "You can make certain sprites 'invisible' to certain others by assigning them different IDs, and choosing the 'ID' test mode for both. Or you can choose the 'current sprites' test mode and start the 'invisible' sprites in a later frame." & RETURN & RETURN & "Mixing test modes on different sprites can lead to interesting results." & RETURN & RETURN & "Do not use the 'all sprites' or the 'all current sprites' modes on more than one sprite at a time. If you do, BOTH sprites will send a 'Collision_NewsFlash' message when they collide." & RETURN & "Using the 'lower channels' options will generate just one message for each collision." & RETURN & RETURN & "ASSOCIATED BEHAVIORS:" & RETURN & "+ Motion vector" & RETURN & "+ Drag and toss"
end
on getBehaviorTooltip me
vTip = "Use with any visible member types." & RETURN & RETURN
vTip = vTip & "Use matte ink (won't work with Flash or" & RETURN
on Collision_GetSpriteList me, theList, callingSpriteNum, theID
if stringp(theID) then
if theID <> ourID then
exit
end if
end if
if callingSpriteNum = spriteNum then
exit
end if
if mySpriteList.getPos(callingSpriteNum) then
exit
end if
theList.append(spriteNum)
end
on Collision_GetIntersectList me, theList
if listp(theList) then
if theList.ilk(#propList) then
i = myIntersectList.count()
repeat while i
touchingSprite = myIntersectList[i]
theList.addProp(spriteNum, touchingSprite)
i = i - 1
end repeat
else
i = myIntersectList.count()
repeat while i
touchingSprite = myIntersectList[i]
theList.append([spriteNum, touchingSprite])
i = i - 1
end repeat
end if
else
return myIntersectList
end if
return theList
end
on getPropertyDescriptionList me
return [#myTestMode: [#comment: "Check for collisions with", #format: #string, #range: ["all sprites", "all current sprites", "sprites in lower channels", "current sprites in lower channels", "sprites with this behavior in lower channels", "sprites with this ID in lower channels"], #default: "all sprites in lower channels"], #ourID: [#comment: "Unique ID for this group (optional):", #format: #string, #default: "ID " & the currentSpriteNum]]